﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Ferreteria.Forms.GestionPedidos
{
    public partial class FrmIncremento : Form

    {
        int Pedid;
        decimal inc;
        bool bandera;
        public static int ventaidpendiente;

        public FrmIncremento(int pedselid)
        {
            InitializeComponent();
            Pedid = pedselid;
            bttnAceptar.Select();
            bandera = true;
        }

        public FrmIncremento() // para facturar una venta desde un remito anterior
        {
            InitializeComponent();
            bttnAceptar.Select();
            bandera = false;
         }

        private void bttnAceptar_Click(object sender, EventArgs e)
        {
            if (bandera == true)
            {
                inc = NumUpInc.Value;
                this.Close();
                frmEmitirFactura EmitirFact = new frmEmitirFactura(Pedid, inc);
                EmitirFact.ShowDialog();
            }
            else
            {
                inc = NumUpInc.Value;
                this.Close();
                frmEmitirFactura EmitirFact = new frmEmitirFactura(inc);
                EmitirFact.ShowDialog();
            }
        }

        private void NumUpInc_ValueChanged(object sender, EventArgs e)
        {
            bttnAceptar.Select();
        }

        private void bttnCancelar_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
